import request from '@/utils/request'

export function topSearch(data) {
  return request({
    url: '/user/goods/topSearch',
    method: 'post',
    data
  })
}

export function searchCriteria(data) {
  return request({
    url: '/user/goods/searchCriteria',
    method: 'post',
    data
  })
}

// 商家商品搜索
export function goodsIndex(data) {
  return request({
    url: '/user/goods/index',
    method: 'post',
    data
  })
}

// 平台商品搜索
export function plat(data) {
  return request({
    url: '/user/goods/plat',
    method: 'post',
    data
  })
}

// 成色列表
export function fineness(data) {
  return request({
    url: '/user/goods/fineness',
    method: 'post',
    data
  })
}

// 商品详情
export function detail(data) {
  return request({
    url: '/user/goods/detail',
    method: 'post',
    data
  })
}

// 商品详情页优惠券
export function coupons(data) {
  return request({
    url: '/user/goods/coupons',
    method: 'post',
    data
  })
}

// 收藏、取消收藏
export function goodsCollect(data) {
  return request({
    url: '/user/goods/collect',
    method: 'post',
    data
  })
}

// 同款商品
export function same(data) {
  return request({
    url: '/user/goods/same',
    method: 'post',
    data
  })
}

// 同款商品最近购买
export function purchase(data) {
  return request({
    url: '/user/goods/purchase',
    method: 'post',
    data
  })
}
